package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.NurturanceConfigMapper;
import com.ruoyi.system.domain.NurturanceConfig;
import com.ruoyi.system.service.INurturanceConfigService;

/**
 * 养号配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-16
 */
@Service
public class NurturanceConfigServiceImpl implements INurturanceConfigService 
{
    @Autowired
    private NurturanceConfigMapper nurturanceConfigMapper;

    /**
     * 查询养号配置
     * 
     * @param id 养号配置主键
     * @return 养号配置
     */
    @Override
    public NurturanceConfig selectNurturanceConfigById(Long id)
    {
        return nurturanceConfigMapper.selectNurturanceConfigById(id);
    }

    /**
     * 查询养号配置列表
     * 
     * @param nurturanceConfig 养号配置
     * @return 养号配置
     */
    @Override
    public List<NurturanceConfig> selectNurturanceConfigList(NurturanceConfig nurturanceConfig)
    {
        return nurturanceConfigMapper.selectNurturanceConfigList(nurturanceConfig);
    }

    /**
     * 新增养号配置
     * 
     * @param nurturanceConfig 养号配置
     * @return 结果
     */
    @Override
    public int insertNurturanceConfig(NurturanceConfig nurturanceConfig)
    {
        nurturanceConfig.setCreateTime(DateUtils.getNowDate());
        return nurturanceConfigMapper.insertNurturanceConfig(nurturanceConfig);
    }

    /**
     * 修改养号配置
     * 
     * @param nurturanceConfig 养号配置
     * @return 结果
     */
    @Override
    public int updateNurturanceConfig(NurturanceConfig nurturanceConfig)
    {
        nurturanceConfig.setUpdateTime(DateUtils.getNowDate());
        return nurturanceConfigMapper.updateNurturanceConfig(nurturanceConfig);
    }

    /**
     * 批量删除养号配置
     * 
     * @param ids 需要删除的养号配置主键
     * @return 结果
     */
    @Override
    public int deleteNurturanceConfigByIds(Long[] ids)
    {
        return nurturanceConfigMapper.deleteNurturanceConfigByIds(ids);
    }

    /**
     * 删除养号配置信息
     * 
     * @param id 养号配置主键
     * @return 结果
     */
    @Override
    public int deleteNurturanceConfigById(Long id)
    {
        return nurturanceConfigMapper.deleteNurturanceConfigById(id);
    }
}
